import {
  getAction,
  postAction,
  postFormData
} from '@/api/manage'
const gateway = '/api/gateway'

const conditionList = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/condition', params) // 素材或搭配 查询条件
const conditionTaskList = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/task/condition', params) // 素材或搭配 查询条件
const themeList = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/list', params) // 素材或搭配 列表
const themeList2 = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/listByClassify', params) // 素材或搭配 列表
const guideDetail = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/guide/detail', params) // 素材管理 查看
const themeDown = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/media/download', params) // 素材管理 下载
const themeMedia = (redisKey) => postFormData(gateway + '/jic-backend-pos/pos/theme/media/get?redisKey=' + redisKey) // 素材管理 下载


const themeStatus = (params) => postAction(gateway + '/pos-center/theme/v2/edit/status', params) // 搭配管理 上下架删除
const publisher = () => postAction(gateway + '/jic-backend-pos/pos/theme/publisher/list') // 发布方管理列表
const themeDrand = () => postAction(gateway + '/jic-backend-pos/pos/theme/brand/list') // 品牌管理列表
const themeClassify = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/classify/list', params) // 分类管理列表
const categoryByCode = (code) => getAction('/sys/api/queryDSysCategoryByCode?code=' + code) // 分类回显接口
const seasonList = () => postAction(gateway + '/jic-backend-pos/pos/theme/season/list') // 季节

const themeDetail = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/detail', params) // 搭配管理查询
const themeEdit = (params) => postAction(gateway + '/pos-center/theme/v2/edit', params) // 搭配管理新增或编辑

const addPack = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/pack', params) //添加素材到分享列表
const currList = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/pack/curr', params) //素材分享列表
const genLink = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/pack/gen', params) //生成分享打包链接
const clearList = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/pack/clear', params) //清空素材打包
const historyList = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/pack/history', params) //历史素材链接
const sharelist = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/sharelist', params) //分享素材列表
const getDetail = (params) => postAction(gateway + '/jic-backend-pos/pos/theme/getDetailByLookId', params) //分享素材列表详情
const storeVoucher = (params) => postAction(gateway + `/jic-backend-pos/pos/storeVoucherAct/pack/list?isStorePackage=${params.isStorePackage}`) //门店包

export {
  conditionList,
  conditionTaskList,
  themeDetail,
  themeEdit,
  themeList,
  themeList2,
  themeStatus,
  publisher,
  themeDrand,
  themeClassify,
  guideDetail,
  themeDown,
  categoryByCode,
  themeMedia,
  seasonList,
  addPack,
  currList,
  genLink,
  clearList,
  historyList,
  sharelist,
  getDetail,
  storeVoucher
}